﻿@model SoftHotel.Models.ReservaEv

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Editar Reserva</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
 <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
   <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>    
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>

   


<script type="text/javascript">
    var linkObj;
    $(function () {
        $(".busqueda").button();

        $('#searchDialog').dialog({
            autoOpen: false,
            width: 900,
            resizable: false,
            modal: true
            //            buttons: {
            //                
            //                "Cancel": function () {
            //                    $(this).dialog("close");
            //                }
            //            }
        });

        $(".busqueda").click(function () {
            //change the title of the dialgo
            linkObj = $(this);
            var dialogDiv = $('#searchDialog');
            var viewUrl = linkObj.attr('href');
            $.get(viewUrl, function (data) {
                dialogDiv.html(data);

                //open dialog
                dialogDiv.dialog('open');
            });
            return false;
        });

    });


    function searchSuccess() {
        var id = $("#update-message").html();
        //we update the table's info
        var parent = linkObj.closest("tr");
        document.getElementById('cliente').value = $("#idCliente" + id.toString()).val();
        document.getElementById('nombreRazonSocial').value = $("#nombres" + id.toString()).val();
        document.getElementById('tipoDocumento').value = $("#tipoDoc" + id.toString()).val();
        document.getElementById('numeroDocumento').value = $("#numDoc" + id.toString()).val();


        //now we can close the dialog
        $('#searchDialog').dialog('close');
        //twitter type notification


    }
    
</script>



 <div id="searchDialog" title="Seleccionar Cliente"></div>
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
         <table id="MainContent_Table1" rules="none" style="border-color: Black; width: 900px; margin-bottom: 0px;">
	<tbody><tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Cliente: </td>
	  <td >
          
            @Html.TextBoxFor(model => model.cliente )
            @Html.ValidationMessageFor(model => model.cliente)
        
         <a class="busqueda" href="/ReservaEv/BuscarCliente"> <img src="/Content/Images/buscar.png" alt="0" title="Buscar" id="" border="0" height="16" width="16"/></a>
           </td>
           <td></td>
          <td style="font-weight: bold;">Estado</td>
	  <td style="width: 20px;"><div>
            
            @Html.DropDownListFor(model => model.nomEstado, Model.Estados, "--Seleccionar--")
        </div></td>
     
	  
	</tr><tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Nombre/Raz&oacute;n Social: </td>
	  <td><div class="editor-field">
            @Html.TextBoxFor(model => model.nombreRazonSocial, new { disabled = "disabled" })
           
        </div> </td>
	   <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Tipo de documento:</td>
	  <td><div class="editor-field">
            @Html.TextBoxFor(model => model.tipoDocumento, new { disabled = "disabled" })
           
        </div></td>
	  <td style="font-weight: bold;">&nbsp;</td>
	  <td>&nbsp;</td>
	</tr>
	<tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">N&uacute;mero de documento:</td>
	  <td><div class="editor-field">
            @Html.TextBoxFor(model => model.numeroDocumento, new { disabled = "disabled" })
            
        </div></td>
	  
	</tr>
	
	
</tbody></table>
       

        <p>
            <input type="submit" value="Guardar" />
        </p>
    </fieldset>
}

@using (Html.BeginForm("Index","ReservaEv",FormMethod.Get))
{<p>
    <input type="submit" name="nuevo2" value="Volver" />
      
</p> }
